package com.listener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author 刘志伟
 * @create 2022/9/22 14:23
 */
@SpringBootApplication
@RestController
public class ListenerApplication implements CommandLineRunner {

    @Autowired
    private  RobotPublisher robotPublisher;

    public static void main(String[] args) {
        SpringApplication.run(ListenerApplication.class, args);
    }

    @RequestMapping("/publisher")
    public void publisher(){
        robotPublisher.publishEvent("alpha-dog");
    }

    @Override
    public void run(String... args) throws Exception {

    }
}
